<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <include file="Public/sidebar"/>
	<div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                        </div>
                        <div class="space-4"></div>
                        <div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form class="form-horizontal" role="form"  method="post">
									<input type="hidden" name="id" value="{$data.id}"/>
									<div class="form-group">
										<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 公告标题 </label>
										<div class="col-sm-9">
											<input type="text"  class="col-xs-12 col-sm-8" name='title' value="{$data.title}"/>
											<span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 公告内容 </label>
										<div class="col-sm-9">
											<textarea class="col-xs-12 col-sm-8" style="height:300px;" name="content">{$data.content|brton}</textarea>
											<span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 是否显示 </label>
										<div class="col-sm-9">
											<label>
												<input name="status" class="ace ace-switch ace-switch-5" type="checkbox" <if condition="$data['status'] eq 1">checked="checked" </if>>
												<span class="lbl"></span>
											</label>
										</div>
									</div>
									
									<div class="col-md-offset-2 col-md-9">
										<button class="btn btn-info btn-submit" type="button" >
											<i class="icon-ok bigger-110"></i>
											<if condition="$data['id'] eq 0">添加<else/>编辑</if>
										</button>

									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- PAGE CONTENT ENDS -->
						</div><!-- /.col -->
					</div><!-- /.row -->
				</div><!-- /.page-content -->
			</div>
		</div><!-- /.main-content -->
	<include file="Public/footer"/>
</div><!-- /.main-container -->
<include file="Public/footerjs"/>
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	$(function () {
		$(".btn").on("click" , function(data){
			var id = $("input[name=id]").val();
			var title = $("input[name=title]").val();
			var content = $("textarea[name=content]").val();
			var status  = $("input[name=status]").is(':checked');
			$.post("{:U('hundle')}" , {id : id,title:title,content:content,status:status} ,function(data){
				if(data.status == 1){
					layer.alert(data.msg, function(){
					   window.location.href = "{:U('index')}";
					});
				}else{
					layer.alert(data.msg);
				}
			});
			return true;
		});
	});
</script>
</body>
</html>
